<!-- <script type="text/javascript" src="/assets/common/plugins/kindeditor/NKeditor-all-min.js"></script>
<script type="text/javascript" src="/assets/common/plugins/kindeditor/libs/JDialog/JDialog.min.js"></script>
<link rel="stylesheet" href="/assets/common/plugins/wangEditor/css/wangEditor.min.css">
<script type="text/javascript" src="/assets/common/plugins/wangEditor/js/wangEditor.min.js"></script> -->
<script src="/assets/common/plugins/ueditor/ueditor.config.js" type="text/javascript"></script>
<script src="/assets/common/plugins/ueditor/ueditor.all.min.js" type="text/javascript"></script>
<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <form id="my-form" class="am-form tpl-form-line-form" method="post">
                    <div class="widget-body">
                        <fieldset>
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">基本信息</div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">标题 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="text" class="tpl-form-input" name="video[video_title]"
                                           value="<?= $model['video_title'] ?>" required>
                                </div>
                            </div>
                            <input type="hidden" name="video[video_id]" value="<?= $model['video_id'] ?>">
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">封面 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <div class="am-form-file">
                                        <div class="am-form-file">
                                            <button type="button"
                                                    class="upload-file am-btn am-btn-secondary am-radius">
                                                <i class="am-icon-cloud-upload"></i> 选择图片
                                            </button>
                                            <div class="uploader-list am-cf">
                                                <?php if ($model['video_img_url']): ?>
                                                    <div class="file-item">
                                                        <a href="<?= $model['video_img_url'] ?>" title="点击查看大图" target="_blank">
                                                            <img src="<?= $model['video_img_url'] ?>">
                                                        </a>
                                                        <input type="hidden" name="video[video_img]"
                                                            value="<?= $model['video_img'] ?>">
                                                        <i class="iconfont icon-shanchu file-item-delete"></i>
                                                    </div>
                                                <?php endif; ?>
                                            </div>
                                        </div>
                                        <div class="help-block am-margin-top-sm">
                                            <small>2:1的图像比例即可，大小2M以下 (可拖拽图片调整显示顺序 )</small>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            

                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label">视频链接</label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="text" class="tpl-form-input" name="video[video_url]"
                                        value="<?= $model['video_url'] ?>">
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label">视频上传</label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="file" class="tpl-form-input" name="video_file" accept="video/*">
                                    <small>支持格式：mp4, avi, mov, mkv，大小不超过50MB。</small>
                                </div>
                            </div>
                            <div class="am-form-group am-padding-top">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">文章内容 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <!-- 加载编辑器的容器 -->
                                    <!-- <textarea id="container" name="article[article_content]"
                                              type="text/plain"><?= $model['content'] ?></textarea> -->
                                              <textarea name="video[content]" class="content" id="content"><?= $model['content'] ?></textarea><script>var editor = new UE.ui.Editor();editor.render("content");</script>  

                                </div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label">播放量</label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="number" class="tpl-form-input" name="video[video_num]"
                                           value="<?= $model['video_num'] ?>">
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">排序 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="number" class="tpl-form-input" name="video[video_sort]"
                                           value="<?= $model['video_sort'] ?>" required>
                                    <small>数字越小越靠前</small>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">视频状态 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <label class="am-radio-inline">
                                        <input type="radio" name="video[video_status]" value="1" data-am-ucheck
                                            <?= $model['video_status'] == 1 ? 'checked' : '' ?>>
                                        显示
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" name="video[video_status]" value="0" data-am-ucheck
                                            <?= $model['video_status'] == 0 ? 'checked' : '' ?>>
                                        隐藏
                                    </label>
                                </div>
                            </div>
                            <!-- 表单提交按钮 -->
                            <div class="am-form-group">
                                <div class="am-u-sm-9 am-u-sm-push-3 am-margin-top-lg">
                                    <button type="submit" class="j-submit am-btn am-btn-secondary">提交
                                    </button>
                                </div>
                            </div>

                        </fieldset>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<!-- 图片文件列表模板 -->
{{include file="layouts/_template/tpl_file_item" /}}

<!-- 文件库弹窗 -->
{{include file="layouts/_template/file_library" /}}

<script src="assets/common/js/vue.min.js"></script>
<script src="assets/common/js/ddsort.js"></script>
<script src="assets/common/plugins/umeditor/umeditor.config.js?v=<?= $version ?>"></script>
<script src="assets/common/plugins/umeditor/umeditor.min.js"></script>
<script src="assets/store/js/goods.spec.js?v=<?= $version ?>"></script>
<script src="assets/common/plugins/umeditor/umeditor.config.js?v=<?= $version ?>"></script>
<script src="assets/common/plugins/umeditor/umeditor.min.js"></script>
<script>

    $(function () {
        // 选择图片
        // 富文本编辑器
        UM.getEditor('container', {
            initialFrameWidth: 600 + 15,
            initialFrameHeight: 600
        });
        $('.upload-file').selectImages({
            name: 'video[video_img]'
            , multiple: false
        });

        $('#my-form').superForm();

    });
</script>
